// import path from "path";
import type { RouteRecordRaw } from "vue-router";
import MV from "../views/MusicHome/MV/index.vue";
// 导出路由
export const routes: Array<RouteRecordRaw> = [
  {
    path: "/qqmusic/tplaymusic",
    name: "TplayMusic",
    component: () => import("@/components/TPlayMusic/index.vue"),
    meta: {
      isShowHeader: false,
    },
  },
  {
    path: "/ly/vidoPlay",
    name: "VidoPlay",
    component: () => import("@/views/MusicHome/Radio/VidoPlay/index.vue"),
  },
  // 匹配搭配/,修改路径去匹配重定向路径
  // 路由器监视地址的改变，从上往下依次匹配，匹配到去去加载响应的组件
  // {
  //   name: "MV",
  //   path: "/",
  //   redirect: "/musichomebar",
  // },
  {
    path: "/",
    redirect: "/musichomebar",
  },
  // 音乐馆 一级路由
  {
    path: "/musichomebar",
    component: () => import("@/views/MusicHome/MusicHomeBar/index.vue"),
    redirect: "/musichomebar/musichome",
    children: [
      // 音乐馆
      {
        path: "musichome",
        name: "MusicHome",
        component: () => import("@/views/MusicHome/Home/index.vue"),
      },
      {
        path: "singer",
        name: "Singer",
        component: () => import("@/views/MusicHome/Singer/index.vue"),
      },
      {
        path: "newcd",
        name: "NewCD",
        component: () => import("@/views/MusicHome/NewCD/index.vue"),
      },
      {
        path: "rank",
        name: "Rank",
        component: () => import("@/views/MusicHome/Rank/index.vue"),
      },
      {
        path: "songcategorylist",
        name: "SongCategoryList",
        component: () => import("@/views/MusicHome/SongCategoryList/index.vue"),
      },
      {
        path: "radio",
        name: "Radio",
        component: () => import("@/views/MusicHome/Radio/index.vue"),
      },
      {
        path: "mv",
        name: "MV",
        component: () => import("@/views/MusicHome/MV/index.vue"),
      },
      {
        path: "digitalalbum",
        name: "DigitalAlbum",
        component: () => import("@/views/MusicHome/DigitalAlbum/index.vue"),
      },
    ],
  },

  // 我的音乐 一级路由
  {
    path: "/myMusic",
    name: "MyMusic",
    component: () => import("@/views/MyMusic/index.vue"),
  },

  // 客户端 一级路由

  // 开发平台 一级路由

  // 播放路由

  {
    path: "/404",
    name: "404",
    component: () => import("@/views/error/404.vue"),
  },

  /* 匹配任意的路由 必须最后注册 */

  {
    name: "newCD",
    path: "/newCD",
    component: import("../views/MusicHome/NewCD/index.vue"),
  },
  {
    name: "singer",
    path: "/singer",
    component: import("../views/MusicHome/Singer/index.vue"),
  },
  {
    name: "singerList",
    path: "/singerList",
    component: import("../views/MusicHome/SingerList/index.vue"),
  },
  {
    path: "/:pathMatch(.*)",
    name: "Any",
    // redirect: "/404",
    meta: {
      hidden: true,
    },
    component: import("../views/MusicHome/MV/index.vue"),
  },
];

export default routes;
